#-----------------------------------------------------------------------------
# Name:        mainFrame.py
# Purpose:     
#
# Author:      <your name>
#
# Created:     2010/11/25
# RCS-ID:      $Id: mainFrame.py $
# Copyright:   (c) 2006
# Licence:     <your licence>
#-----------------------------------------------------------------------------
#Boa:Frame:mainFrame

import wx
from cadFornFrame import *
from cadFuncFrame import *
from cadProdFrame import *
from pedEntradaFrame import *
from pedSaidaFrame import *


#criando lista para armazenar os produtos
listaProdutos = []

def create(parent):
    return mainFrame(parent)

[wxID_MAINFRAME, wxID_MAINFRAMESTATUSBAR1, 
] = [wx.NewId() for _init_ctrls in range(2)]

[wxID_MAINFRAMEMOVIMENTOMENUCOMPRAS, wxID_MAINFRAMEMOVIMENTOMENUVENDAS, 
] = [wx.NewId() for _init_coll_movimentoMenu_Items in range(2)]

[wxID_MAINFRAMECADASTROMENUFORNECEDORES, 
 wxID_MAINFRAMECADASTROMENUFUNCIONARIOS, wxID_MAINFRAMECADASTROMENUPRODUTOS, 
] = [wx.NewId() for _init_coll_cadastroMenu_Items in range(3)]

[wxID_MAINFRAMERELATORIOSMENUCADPESS, wxID_MAINFRAMERELATORIOSMENUCADPROD, 
 wxID_MAINFRAMERELATORIOSMENUCAPAG, wxID_MAINFRAMERELATORIOSMENUCAREC, 
 wxID_MAINFRAMERELATORIOSMENUCOMPRAS, wxID_MAINFRAMERELATORIOSMENUVENDAS, 
] = [wx.NewId() for _init_coll_relatoriosMenu_Items in range(6)]

[wxID_MAINFRAMERELATORIOMENUCONTAPAGAR, 
 wxID_MAINFRAMERELATORIOMENUCONTARECEBER, 
] = [wx.NewId() for _init_coll_relatorioMenu_Items in range(2)]

[wxID_MAINFRAMEPARAMETROSMENUDEFINIR] = [wx.NewId() for _init_coll_parametrosMenu_Items in range(1)]

[wxID_MAINFRAMESAIRMENUSAIR] = [wx.NewId() for _init_coll_sairMenu_Items in range(1)]

class mainFrame(wx.Frame):
    def _init_coll_cadastroMenu_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='', id=wxID_MAINFRAMECADASTROMENUFUNCIONARIOS,
              kind=wx.ITEM_NORMAL, text=u'Funcion\xe1rios')
        parent.Append(help='', id=wxID_MAINFRAMECADASTROMENUFORNECEDORES,
              kind=wx.ITEM_NORMAL, text=u'Fornecedores')
        parent.Append(help='', id=wxID_MAINFRAMECADASTROMENUPRODUTOS,
              kind=wx.ITEM_NORMAL, text=u'Produtos')
        self.Bind(wx.EVT_MENU, self.OnCadastroMenuFuncionariosMenu,
              id=wxID_MAINFRAMECADASTROMENUFUNCIONARIOS)
        self.Bind(wx.EVT_MENU, self.OnCadastroMenuFornecedoresMenu,
              id=wxID_MAINFRAMECADASTROMENUFORNECEDORES)
        self.Bind(wx.EVT_MENU, self.OnCadastroMenuProdutosMenu,
              id=wxID_MAINFRAMECADASTROMENUPRODUTOS)

    def _init_coll_menuBar_Menus(self, parent):
        # generated method, don't edit

        parent.Append(menu=self.cadastroMenu, title=u'Cadastro')
        parent.Append(menu=self.movimentoMenu, title=u'Movimento')
        parent.Append(menu=self.relatorioMenu, title=u'Relatorios')
        parent.Append(menu=self.sairMenu, title=u'Sair')

    def _init_coll_relatorioMenu_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='', id=wxID_MAINFRAMERELATORIOMENUCONTAPAGAR,
              kind=wx.ITEM_NORMAL, text=u'Contas a Pagar')
        parent.Append(help='', id=wxID_MAINFRAMERELATORIOMENUCONTARECEBER,
              kind=wx.ITEM_NORMAL, text=u'Contas a Receber')
        self.Bind(wx.EVT_MENU, self.OnRelatorioMenuCapagMenu,
              id=wxID_MAINFRAMERELATORIOMENUCONTAPAGAR)
        self.Bind(wx.EVT_MENU, self.OnFinanceiroMenuCarecMenu,
              id=wxID_MAINFRAMERELATORIOMENUCONTARECEBER)

    def _init_coll_movimentoMenu_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='', id=wxID_MAINFRAMEMOVIMENTOMENUCOMPRAS,
              kind=wx.ITEM_NORMAL, text=u'Compras')
        parent.Append(help='', id=wxID_MAINFRAMEMOVIMENTOMENUVENDAS,
              kind=wx.ITEM_NORMAL, text=u'Vendas')
        self.Bind(wx.EVT_MENU, self.OnMovimentoMenuComprasMenu,
              id=wxID_MAINFRAMEMOVIMENTOMENUCOMPRAS)
        self.Bind(wx.EVT_MENU, self.OnMovimentoMenuVendasMenu,
              id=wxID_MAINFRAMEMOVIMENTOMENUVENDAS)

    def _init_coll_sairMenu_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='', id=wxID_MAINFRAMESAIRMENUSAIR,
              kind=wx.ITEM_NORMAL, text=u'Sair')
        self.Bind(wx.EVT_MENU, self.OnSairMenuSairMenu,
              id=wxID_MAINFRAMESAIRMENUSAIR)

    def _init_coll_parametrosMenu_Items(self, parent):
        # generated method, don't edit

        parent.Append(help='', id=wxID_MAINFRAMEPARAMETROSMENUDEFINIR,
              kind=wx.ITEM_NORMAL, text=u'Definir')
        self.Bind(wx.EVT_MENU, self.OnRelatoriosMenuCarecMenu,
              id=wxID_MAINFRAMEPARAMETROSMENUDEFINIR)

    def _init_coll_statusBar1_Fields(self, parent):
        # generated method, don't edit
        parent.SetFieldsCount(1)

        parent.SetStatusText(number=0, text=u'Status')

        parent.SetStatusWidths([-1])

    def _init_utils(self):
        # generated method, don't edit
        self.cadastroMenu = wx.Menu(title=u'')
        self.cadastroMenu.SetEvtHandlerEnabled(True)

        self.movimentoMenu = wx.Menu(title=u'')

        self.relatorioMenu = wx.Menu(title=u'')

        self.parametrosMenu = wx.Menu(title=u'')

        self.sairMenu = wx.Menu(title=u'')

        self.menuBar = wx.MenuBar()
        self.menuBar.SetEvtHandlerEnabled(True)

        self._init_coll_cadastroMenu_Items(self.cadastroMenu)
        self._init_coll_movimentoMenu_Items(self.movimentoMenu)
        self._init_coll_relatorioMenu_Items(self.relatorioMenu)
        self._init_coll_parametrosMenu_Items(self.parametrosMenu)
        self._init_coll_sairMenu_Items(self.sairMenu)
        self._init_coll_menuBar_Menus(self.menuBar)

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_MAINFRAME, name=u'mainFrame',
              parent=prnt, pos=wx.Point(-8, -8), size=wx.Size(1382, 754),
              style=wx.MAXIMIZE_BOX | wx.MAXIMIZE | wx.DEFAULT_FRAME_STYLE,
              title=u'suPymercado')
        self._init_utils()
        self.SetClientSize(wx.Size(1366, 716))
        self.SetHelpText(u'')
        self.SetMenuBar(self.menuBar)
        self.SetAutoLayout(False)

        self.statusBar1 = wx.StatusBar(id=wxID_MAINFRAMESTATUSBAR1,
              name='statusBar1', parent=self, style=0)
        self._init_coll_statusBar1_Fields(self.statusBar1)
        self.SetStatusBar(self.statusBar1)

    def __init__(self, parent, usuario):
        self._init_ctrls(parent)
        self.usuario = usuario

    def OnMovimentoMenuComprasMenu(self, event):
        menu = pedEntradaFrame(None)
        menu.Show()

    def OnMovimentoMenuVendasMenu(self, event):
        menu = pedVendaFrame(None)
        menu.Show()

    def OnRelatorioMenuCapagMenu(self, event):
        event.Skip()

    def OnCadastroMenuFuncionariosMenu(self, event):
        menu = cadFuncFrame(None)
        menu.Show()

    def OnCadastroMenuFornecedoresMenu(self, event):
        menu = cadFornFrame(None)
        menu.Show()

    def OnCadastroMenuProdutosMenu(self, event):
        menu = cadProdFrame(None)
        menu.Show()

    def OnRelatoriosMenuCarecMenu(self, event):
        event.Skip()

    def OnSairMenuSairMenu(self, event):
        event.Skip()

    def OnFinanceiroMenuCarecMenu(self, event):
        event.Skip()
